/*
 * @lc app=leetcode.cn id=1033 lang=javascript
 *
 * [1033] 移动石子直到连续
 */

// @lc code=start
/**
 * @param {number} a
 * @param {number} b
 * @param {number} c
 * @return {number[]}
 */
var numMovesStones = function (a, b, c) {
  if (a > b) [a, b] = [b, a];
  if (a > c) [a, c] = [c, a];
  if (b > c) [b, c] = [c, b];
  let dif1 = b - a - 1, dif2 = c - b - 1;
  if (dif1 === 1 || dif2 === 1) return [1, dif2 + dif1];
  return [(+!!dif1) + (+!!dif2), dif2 + dif1];
};
// @lc code=end

// numMovesStones(7, 4, 1);